<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => ['auth:api']], function () {
    /**
     * 管理员管理
     */
    Route::get('profile', 'AdminController@getProfile');
    /**
     * 用户管理
     */
    Route::resource('admin','AdminController', ['except' => ['create', 'edit']]);
    /**
     * 用户权限
     */
    Route::resource('role', 'RoleController', ['except' => ['create', 'edit']]);

    Route::group(['prefix' => 'data-provider'], function () {
        Route::get('permission-list', 'DataProviderController@getPermission');                          //所有权限
        Route::get('roles-list', 'DataProviderController@getRole');                                       //所有角色
    });
});
